﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using digitwhu.Logic.BusinessLogicControl;

namespace digitwhu.Controllers
{
    public class WeiboController : Controller
    {
        //微博列表
        [HttpGet]
        public String List(String placeId,String type)
        {
            return BlogLogicControl.GetBlog(placeId, type);
        }
        //增加微博
        [HttpPost]
        public String Add(String placeId, String type, String userId, String content, String replyType)
        {
            return BlogLogicControl.AddOriginalBlog(placeId, type, userId, content, replyType);
        }
        //转发微博
        [HttpPost]
        public String Transmit(String placeId, String type, String originBlogId, String userId, String tranReason, String replyType)
        {
            return BlogLogicControl.AddTranBlog(placeId, type, originBlogId, userId, tranReason, replyType);
        }
        //删除微博
        [HttpDelete]
        public void Remove(String type, String blogId)
        {
            BlogLogicControl.DeleteBlog(type, blogId);
        }
        //微博评论列表
        [HttpGet]
        public String CommentList(String type, String blogId)
        {
            return BlogLogicControl.GetBlogComment(type, blogId);
        }
        //增加评论
        [HttpPost]
        public String AddComment(string type, string blogId, string userId, string comment)
        {
            return BlogLogicControl.AddComment(type, blogId, userId, comment);
        }
        //删除评论
        [HttpDelete]
        public void RemoveComment(string type, string commentId)
        {
            BlogLogicControl.DeleteComment(type, commentId);
        }

        //增加关注
        public void AddFocus(String from,String to)
        {
            BlogLogicControl.AddAttention(from, to);
        }
        //删除关注
        public void RemoveFocus(String from, String to)
        {
            BlogLogicControl.DeleteAttention(from, to);
        }
        //增加拉黑
        public void AddBlack(String from, String to)
        {
            BlogLogicControl.AddBlack(from, to);
        }
        //删除拉黑
        public void RemoveBlack(String from, String to)
        {
            BlogLogicControl.DeleteBlack(from, to);
        }
        //增加私信
        public void AddMsg(String msgFrom,String msgTo,String msgContent)
        {
            BlogLogicControl.AddPrivateMsg(msgFrom, msgTo, msgContent);
        }
    }
}
